<div id="block-lists" class="block">
  <div class="secondary-navigation">
    <ul>
      <% Category.all.each_with_index do |c, i|  %>
        <li class="<%= 0==i ? 'first' : ''  %> <%=  c.name == @article.category.name ? 'active' : '' %>  "><a href="/news?keywords=<%= c.name   %>"><%= c.name %></a></li>
      <% end %>
      <!--
      
      < % Basetable.find_by_name('文章热门关键字').content.split(" ").each do |c, i|  %>
        <li class="< %= 0==i ? 'first' : ''  %> < %=  c == params[:keywords] ? 'active' : '' %>  ">
        <a href="/news?keywords=< %= c   %>">< %= c %></a>
        </li>
       < % end %>
-->
    </ul>
    <div class="clear">   </div>
  </div>            
  
  <div class="content">
    
    <h1>行业快讯</h1>
    <table>
      
      <%  @article.article_images.each do |i| %>
        <tr>
          <td><%=h i.sort %></td>
          <td><%=image_tag i.image.url ,:size=>"60x60" %></td>
        </tr>
      <%end%>
    </table>
    
    
    <table class="table">
      <tr class="odd">
        <td width="60px">添加用户</td>
        <td width="200px">  <%=h @article.user.name %></td>
      </tr>
      
      <tr class="odd">
        <td width="60px">标题</td>
        <td width="200px">   <%=h @article.title %></td>
      </tr>
      <tr class="odd">
        <td width="60px">副标题</td>
        <td width="200px">    <%=h @article.subhead %></td>
      </tr>
      <tr class="odd">
        <td width="60px">来源</td>
        <td width="200px">    <%=h @article.from %></td>
      </tr>
      <tr class="odd">
        <td width="60px">作者</td>
        <td width="200px">   <%=h @article.author %></td>
      </tr>
      <tr class="odd">
        <td width="60px">摘要</td>
        <td width="200px">   <%=h @article.summary %></td>
      </tr>
      <tr class="odd">
        <td width="60px">内容</td>
        <td width="200px">   <%=h @article.body %></td>
      </tr>
      
      <%  @article_comments.each do |comment|%>
        <tr class="odd">
          <td width="200px"><%=h comment.user.name %></td>
          <td width="200px"><%=h comment.content %></td>
          <td width="200px">   <%=h comment.try(:user).try(:name) %></td>
        </tr>
      <% end %>
      <% form_for(@article_comment , :url => forums_path ) do |f| %>
        <tr class="odd">
          <td  colspan="2">
            <%= f.error_messages %><br />
            回复<br />
          <%= f.text_area :content ,:size => '100x5' %></td>
        </tr>  
        <tr class="odd">
          <td  colspan="2">  <%= f.hidden_field :article_id%>
          <%= f.hidden_field :ipaddr %></td>
        </tr>
        <tr class="odd">
          <td  colspan="2">     <%= f.submit 'Create' %></td>
        </tr>  
      
      <% end %>
    </table>
    <%= will_paginate @article_comments  %>
            
    <br />
  </div>
</div>
